package org.studiox.graph.persistence.mybatis.tk.domain;

import org.studiox.graph.persistence.mybatis.tk.base.BaseGraphDO;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Objects;

@Entity
@Table(name = "graph_vertex")
public class GraphVertexDO extends BaseGraphDO {

  @Column(name = "uniq")
  private String uniq;

  @Column(name = "janus_vertex_id")
  private Long janusVertexId;

  @Column(name = "neo4j_vertex_id")
  private Long neo4jVertexId;

  @Column(name = "nebula_vertex_id")
  private Long nebulaVertexId;

  @Column(name = "temp")
  private Boolean temp;

  public String getUniq() {
    return uniq;
  }

  public void setUniq(String uniq) {
    this.uniq = uniq;
  }

  public Long getJanusVertexId() {
    return janusVertexId;
  }

  public void setJanusVertexId(Long janusVertexId) {
    this.janusVertexId = janusVertexId;
  }

  public Long getNeo4jVertexId() {
    return neo4jVertexId;
  }

  public void setNeo4jVertexId(Long neo4jVertexId) {
    this.neo4jVertexId = neo4jVertexId;
  }

  public Long getNebulaVertexId() {
    return nebulaVertexId;
  }

  public void setNebulaVertexId(Long nebulaVertexId) {
    this.nebulaVertexId = nebulaVertexId;
  }

  public Boolean getTemp() {
    return temp;
  }

  public void setTemp(Boolean temp) {
    this.temp = temp;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    if (!super.equals(o)) {
      return false;
    }
    GraphVertexDO that = (GraphVertexDO) o;
    return Objects.equals(uniq, that.uniq)
        && Objects.equals(janusVertexId, that.janusVertexId)
        && Objects.equals(neo4jVertexId, that.neo4jVertexId)
        && Objects.equals(nebulaVertexId, that.nebulaVertexId)
        && Objects.equals(temp, that.temp);
  }

  @Override
  public int hashCode() {
    return Objects.hash(super.hashCode(), uniq, janusVertexId, neo4jVertexId, nebulaVertexId, temp);
  }

  @Override
  public String toString() {
    final StringBuffer sb = new StringBuffer("GraphVertexDO{");
    sb.append("uniq='").append(uniq).append('\'');
    sb.append(", janusVertexId=").append(janusVertexId);
    sb.append(", neo4jVertexId=").append(neo4jVertexId);
    sb.append(", nebulaVertexId=").append(nebulaVertexId);
    sb.append(", temp=").append(temp);
    sb.append('}');
    return sb.toString();
  }
}
